package org.vergil.core.thread.producerconsumer;

/**
 * Created by vergil on 17-3-18.
 */
public class App {
    public static void main(String[] args){
        Business business = new Business();
        Consumer consumer = new Consumer(business);
        Producer producer = new Producer(business);

        Thread thread1 = new Thread(producer,"producer1");
        Thread thread2 = new Thread(producer,"producer2");
        Thread thread3 = new Thread(producer,"producer3");
        thread1.start();
        thread2.start();
        thread3.start();


        Thread consumer1 = new Thread(consumer,"consumer1");
        Thread consumer2 = new Thread(consumer,"consumer2");
        Thread consumer3 = new Thread(consumer,"consumer3");
        consumer1.start();
        consumer2.start();
        consumer3.start();
    }
}
